<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>vue2响应式原理：数据劫持 + 发布订阅模式</title>
</head>

<body>
	订阅视图-1：<span id="box1"></span><br />
	订阅视图-2：<span id="box2"></span>
</body>
<script src="./index.js"></script>
<script>
	let dataObj = {};
	dataHijack({
		data: dataObj,
		tag: 'view-1',
		datakey: 'one',
		selector: 'box1'
	});
	dataHijack({
		data: dataObj,
		tag: 'view-2',
		datakey: 'two',
		selector: 'box2'
	});

	dataObj.one = '叶';
	dataObj.two = '放';
</script>

</html>